Page({

  /**
   * 页面的初始数据
   */
  data: {
    name:"",
    ID:"",
    tem:"",
    blood:"",
    pulse:"",
    breath:"",
    weight:"",
    callname:"",
    kook:0,
    call2:false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
    
  },



// 姓名获取
  nameInput :function (e) { 
    this.setData({ 
      name:e.detail.value,
    })   
    // console.log(this.data.name);
    wx.setStorageSync('name', this.data.name)
  }, 
  // 机器id获取
  IDInput :function (e) { 
    this.setData({ 
      ID:e.detail.value,
    })   
    // console.log(this.data.ID);
    wx.setStorageSync('ID', this.data.ID)
  }, 


  // 获取输入温度
  temInput :function (e) { 
    this.setData({ 
      tem:e.detail.value,
    })   
    // console.log(this.data.tem);
    wx.setStorageSync('tem', this.data.tem)
  }, 

  // 获取输入xueya
  bloodInput :function (e) { 
    this.setData({ 
      blood:e.detail.value 
    })   
    // console.log(this.data.tem);
    wx.setStorageSync('blood', this.data.blood)
  }, 

  // 获取输入pulse
  pulseInput :function (e) { 
    this.setData({ 
      pulse:e.detail.value 
    })   
    // console.log(this.data.tem);
    wx.setStorageSync('pulse', this.data.pulse)
  }, 

  // 获取输入breath
  breathInput :function (e) { 
    this.setData({ 
      breath:e.detail.value 
    })   
    // console.log(this.data.tem);
    wx.setStorageSync('breath', this.data.breath)
  }, 

  // 获取输入weight
  weightInput :function (e) { 
    this.setData({ 
      weight:e.detail.value 
    })   
    // console.log(this.data.tem);
    wx.setStorageSync('weight', this.data.weight)
  }, 

  navigate(){
    wx.navigateTo({
      url: '../select/select',
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    // 呼叫
    this.data.kook=wx.getStorageSync('kook'),

    this.data.call2=wx.getStorageSync('call2'),
    this.data.callname=wx.getStorageSync('callname'),

    this.setData({
      call2:this.data.call2,
      callname:this.data.callname,
      kook:this.data.kook
    })
    console.log(this.data.call2);
    console.log(this.data.kook);
    if (this.data.call2) {
      wx.showModal({
        title: '呼叫',
        content: this.data.callname+'呼叫',
      })
    }

    if (this.data.kook%10!=0) {
      wx.showModal({
        title: '呼叫',
        content: (this.data.kook-this.data.kook%10)/10+'呼叫',
      })
    }
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})